<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<!-- <script src="https://unpkg.com/axios/dist/axios.min.js"></script> -->
<body>
</body>
<script>
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("post", "http://localhost:8080/api/user/login", true);
xmlHttp.send(JSON.stringify({username:"李四", password:"123456"}));//"
xmlHttp.onreadystatechange = function() {
  if (xmlHttp.readyState == 4){
    if (xmlHttp.status == 200) {
        //取得返回的数据
        console.log(xmlHttp.responseText);
    }
  }
}
</script>
</html>